home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpmul310.zip / MULAWARE.INT < prev    next >
Text File  |  1992-08-12  |  4KB  |  145 lines

  1. Unit MulAware;
  2. {
  3.   Multitasking Routines for TP 6.0
  4.  
  5.   Copyright (c) 1991,1992 A.B.S. - ALL RIGHTS RESERVED
  6.  
  7.   1.00+  Internal Use Only
  8.   2.00   First Distributed Release
  9.   2.10   Fixed Windows Checking
  10.   2.11   Took out VMiX Code
  11.   2.20   Fixed DDOS Code - Locking up Novell
  12.   2.21   Fixed Code - Tried to be too smart for my own good
  13.   2.22   Fixed Code Again - Was Checking for DV 2.40+ instead of 2.26+
  14.   3.00   Complete ReWrite
  15.   3.01   Minor Update
  16.   3.10   Optimizations
  17. }
  18.  
  19. {$A-,B-,D-,F-,I-,N-,O-,R-,S-,V-}
  20.  
  21. Interface
  22.  
  23. Const
  24.   MulAwareVer = '3.10';
  25.  
  26. Type
  27.   MultiType = (None,          {No Supported MultiTasker Found}
  28.                DESQview,      {DESQview 2.26+}
  29.                TopView,       {TopView, TaskView, DESQview 2.00- 2.25,
  30.                                OmniView, or Compatible}
  31.                TaskSwitcher,  {MS DOS 5.0 Task Switcher or Compatible}
  32.                DoubleDOS,     {DoubleDOS}
  33.                WinEnh,        {MS Windows 3.x in Enhanced Mode}
  34.                Win386,        {MS Windows 386 v2.xx}
  35.                WinStandard,   {MS Windows in Real or Standard Mode}
  36.                OS2};          {OS/2 1.3 or 2.0}
  37.  
  38.  
  39. Var
  40.   MultiTasker : MultiType;
  41.  
  42. Procedure TimeSlice;
  43. {
  44.  Causes the current task to give up the rest of its time slice.
  45.  Useful in loops while waiting for keyboard input.  This procedure
  46.  calls the DOS idle interrupt if MultiTasker = None.
  47.  
  48.  example:
  49.    While not Keypressed do TimeSlice;
  50.  
  51.  Supported by:
  52.    None
  53.    DESQview
  54.    WinEnh
  55.    OS2
  56.    DoubleDOS
  57.    TopView
  58.    Win386
  59.    TaskSwitcher
  60.    Win286
  61. }
  62.  
  63. Procedure PreventSwitching;
  64. {
  65.  Suspends multitasking and only services the current task.  Useful during
  66.  critical program functions.  Don't leave on for too long!  Call
  67.  ResumeSwitching to resume multitasking.
  68.  
  69.  Supported by:
  70.    DESQview
  71.    WinEnh
  72.    DoubleDOS
  73.    TopView
  74. }
  75.  
  76. Procedure ResumeSwitching;
  77. {
  78.  Called to resume multitasking after it has been suspended by
  79.  PreventSwitching.
  80.  
  81.  Supported by:
  82.    DESQview
  83.    WinEnh
  84.    DoubleDOS
  85.    TopView
  86. }
  87.  
  88. Function  MulVersion : Word;
  89. {
  90.  Returns the Version Number.  The high byte contains the major number, and
  91.  the low byte contains the minor number.  The number may be accessed like
  92.  this - WriteLn('Version ', Hi(MulVersion), '.', Lo(MulVersion)).
  93.  
  94.  Example:
  95.    DESQview 2.42 returns $022A (554).
  96.  
  97.  Supported by:
  98.    DESQview
  99.    WinEnh
  100.    OS2
  101.    TopView (returns 0 for TaskView & DESQview 2.00-2.25}
  102. }
  103.  
  104. Function  VirtualBuffer : Word;
  105. {
  106.  Returns the address of the virtual video buffer.  Useful for doing
  107.  direct screen writes without 'bleed through'.  Under DoubleDOS, this
  108.  procedure must be called everytime you wish to do a direct write,
  109.  because the buffer changes.  The standard video address is returned
  110.  under a non-supported multitasker.  This is only valid for standard
  111.  text modes!
  112.  
  113.  Supported by:
  114.    DESQview
  115.    DoubleDOS
  116.    TopView
  117. }
  118.  
  119. Procedure TV_UpdateBuffer(Num : Word; Buffer, CharOffset : Word);
  120. {
  121.  Must be called when running under TaskView or clones to update the
  122.  screen from the virtual buffer.  This may be called under DESQview,
  123.  but doing so will cause DESQview to stop updating the screen
  124.  automatically.  Num contains the number of sequential characters
  125.  that were changed.  Buffer:CharOffset points to the first character
  126.  changed.  Buffer is the VirtualBuffer.  CharOffset is the Offset of
  127.  the first character changed.
  128.  
  129.  Do NOT call with Num = 0!
  130.  
  131.  Supported by:
  132.    DESQview
  133.    TopView
  134. }
  135.  
  136. Function  DDOS_Visible : Boolean;
  137. {
  138.  Returns true if the current task is the visible task under DoubleDOS.
  139.  Returns false if DDOS NOT running OR if the current task is the
  140.  invisible task.  You must check MultiTasker if a false is returned.
  141.  
  142.  Supported by:
  143.    DoubleDOS
  144. }
  145.